#include "../log/log.h"

int main()
{
    std::unique_ptr<Log::GlobalLoggerBuilder> builder(new Log::GlobalLoggerBuilder()); //实例化全局⽇志器建造者 
    builder->buildloggerName("async_logger");//设置⽇志器名称 
    builder->buildLoggerType(Log::BuildType::LOGGER_ASYNC);
    builder->buildAsyncUnSafe();
    builder->buildsink<Log::StdOutSink>();
    builder->buildsink<Log::FileSink>("./logfile/async.log");
    builder->buildsink<Log::RollBySizeSink>("./logfile/roll-", 1024 * 1024);
    builder->build();


    Log::Logger::ptr logger = Log::getlLogger("async_logger");
    logger->debug("%s", "测试全局接口");
    logger->info("%s", "测试全局接口");
    logger->warn("%s", "测试全局接口");
    logger->error("%s", "测试全局接口");
    logger->fatal("%s", "测试全局接口");
    return 0;
}